<html>

<head>
    <style>
        .path {
            stroke-dasharray: 150;
            stroke-dashoffset: 0;
        }
    </style>
</head>

<body>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="500" height="500" viewBox="0 0 500 500" fill="none"
        stroke-width="5">
        <path class="path" stroke="red" d="M100,250H400" />
        <circle cx="100" cy="260" r="3" fill="green" />
        <circle cx="250" cy="260" r="3" fill="green" />
        <circle cx="400" cy="260" r="3" fill="green" />
    </svg>
</body>
<script>
    console.log(document.getElementsByClassName('path'))
</script>

</html>